﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace VGSoftware.AutoExtractService
{
	internal class Settings
	{
		private static IList<DirectoryInfo> _foldersToWatch;
		private static IList<string> _exclude;

		public static IList<DirectoryInfo> FoldersToWatch
		{
			get
			{
				if (_foldersToWatch == null)
				{
					_foldersToWatch = new List<DirectoryInfo>(Properties.Settings.Default.FoldersToWatch.Count);
					foreach (string path in Properties.Settings.Default.FoldersToWatch)
					{
						DirectoryInfo directory = new DirectoryInfo(path);
						if (directory.Exists)
						{
							_foldersToWatch.Add(directory);
						}
					}
				}
				return _foldersToWatch;
			}
		}

		public static IList<string> Exclude
		{
			get
			{
				if (_exclude == null)
				{
					_exclude = new List<string>(Properties.Settings.Default.FoldersToExclude.Cast<string>());
				}
				return _exclude;
			}
		}
	}
}
